<?php // Eugenio Ghiglia <eugenio@blux.org>
session_start();
$layout='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>^title^</title>
<meta name="description" content="^description^" />
<meta name="keywords" content="^keywords^" />
<meta name="robots" content="index,follow" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta http-equiv="Content-Language" content="IT" />
<link href="/css/style.css" rel="stylesheet" type="text/css" media="screen"/>
<link href="/css/validationEngine.jquery.css" rel="stylesheet" type="text/css"/>
<link href="/css/uploadify.css" rel="stylesheet" type="text/css"/>
<link href="/css/smoothDivScroll.css" rel="stylesheet" type="text/css"/>
<link href="/css/colorbox.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="/js/util.js"></script>
<script type="text/javascript" src="/js/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="/js/jquery.ui.widget.js"></script>
<script type="text/javascript" src="/js/swfobject.js"></script>
<script type="text/javascript" src="/js/swfobject14.js"></script>
<script src="/js/jquery.validationEngine-it.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/jquery.uploadify.v2.1.4.min.js" type="text/javascript"></script>
<script src="/js/jquery.smoothDivScroll-1.1-min.js" type="text/javascript"></script>
<script src="/js/jquery.colorbox-min.js" type="text/javascript"></script>
<script type="text/javascript">
    jQuery(document).ready(function($){
                $("a[rel=\'colorbox\']").colorbox({photo:true,scalePhotos:true,maxWidth:"100%",maxHeight:"100%"});
            });
</script>
</head>
<body>
<div id="wrapper">
    <div id="header-wrapper">
        <div style="width:468px;height:60px;border:1px solid #000000;float:right;margin-top:15px;position:absolute;margin-left:50%;"><a href="/adv/adv.php?b=test">468x60</a></div>
        <div id="header">            
            <div id="logo">
                <h1><a href="http://'.$_SERVER['SERVER_NAME'].'">'.$_SESSION['CONFIG']['TITLE'].'</a></h1>
                <p>'.$_SESSION['CONFIG']['SUBTITLE'].'</p>
            </div>
            <div id="menu">
                <ul>
                    <li><a href="/">Home</a></li> 
                    <li><a href="/cerca.html">Cerca annunci</a></li>
                    <li><a href="/pubblica.html">Pubblica un annuncio</a></li>
                    <li><a href="/registrazione.html">Registrati</a></li>
                </ul>
            </div>
        </div>
    </div>
    <!-- end #header -->
    <div id="page">
        <div id="page-bgtop">
            <div id="page-bgbtm">
                <div id="content">
                    ^html^
                    <div style="clear: both;">&nbsp;</div>
                </div>
                <!-- end #content -->
                <div id="sidebar">
                    <ul>
                        <li>
                            <div id="search">
                                <form method="get" action="cerca.html">
                                    <div>
                                        <input type="text" name="q" id="search-text" value="" />
                                        <input type="submit" id="search-submit" value="TROVA" />
                                    </div>
                                </form>
                            </div>
                            <div style="clear: both;">&nbsp;</div>
                        </li>
                        <li>';

if ($_SESSION['LOGGED']) {
$layout.='
          <div id="userForm">
            <p>Ciao <b><a href="/area-utente.html?dati=true">'._utenti_get_name($_SESSION['LOGGED']).'</a></b></p>
            <ul>
                <li><a href="/area-utente.html?annunci=true">I tuoi annunci</a></li>
                <li><a href="/area-utente.html?chgpsw=true">Cambia password</a></li>
                <li><a href="/?logout=true">Esci</a></li>
            </ul>
          </div>
          <div style="clear: both;">&nbsp;</div>';    
} else {
$layout.='                        
                            <div id="loginForm">
                                <p><span class="title">Log-in</span><br/>Accesso per gli utenti registrati.</p>
                                <form action="" method="post">
                                    <div>
                                        <input type="submit" value="ENTRA"/>
                                        <input type="text" name="login_email" style="float:left"/>
                                        <input type="password" name="login_password" style="float:left"/>
                                        <input type="hidden" name="login_ticket" value="'.mktime().'"/>
                                    </div>
                                    <div style="clear: both;">&nbsp;</div>
                                </form>
                                <p><a href="registrazione.html">Clicca qui se non sei registrato</a><br/>
                                   <a href="password-dimenticata.html">Clicca qui se hai dimenticato la password</a></p>
                            </div>
                            <div style="clear: both;">&nbsp;</div>
';
} 
                            
$layout.='                            
                        </li>
                        <li>
                            <h2>Canali e Categorie</h2>
                              <div id="flashcontent">Installa flash e attiva javascript!</div>
                              <script type="text/javascript">
                                var so = new SWFObject("/js/tagcloud.swf", "tagcloud", "280", "180", "7", "##ffffff");
                                // uncomment next line to enable transparency
                                so.addParam("wmode", "transparent");
                                so.addVariable("tcolor", "0x76476B");
                                so.addVariable("mode", "tags");
                                so.addVariable("distr", "true");
                                so.addVariable("tspeed", "150");
                                so.addVariable("tagcloud", "'.addslashes(_annunci_tag_cloud()).'");
                                so.write("flashcontent");
                              </script>  
                            
                        </li>
                        <li>
                            <div style="width:280;margin-top:25px;background: #F3F3EE;border:1px solid #C0C0C0;padding:5px;">250x250?</div>
                        <li>
                        <li>
                            <h2>Links e feed</h2>
                            <ul>
                                <li><a href="/rss.xml" alt="" title="rimani aggiornato su tutti gli annunci pubblicati">Feed RSS</a></li>
                            </ul>
                        </li>
                        <li>
                            <h2>Ultimi annunci</h2>
                            <div id="box_recenti" style="width:280;background:#F3F3EE;border:1px solid #C0C0C0;padding:5px;">
                                '._annunci_box_recenti(5).'
                            </div>
                        </li>
                    </ul>
                </div>
                <!-- end #sidebar -->
                <div style="clear: both;">&nbsp;</div>
            </div>
        </div>
    </div>
    <!-- end #page -->
</div>
<div id="footer">
    <p>Copyright (c) '.date('Y').' '.$_SERVER['SERVER_NAME'].'. All rights reserved.<br/>
       <a href="/sitemap.xml">sitemap</a> | <a href="/rss.xml">RSS</a></p>
</div>
</div>
</body>
</html>';
?>